'use strict';
//1.正确使用egg搭建后台服务（10分）
const Service = require('egg').Service;

class loginService extends Service {
  async login({name,pwd}) {
    return await this.app.mysql.select('user', {where:{name,pwd}});
  }
  async getUser(name) {
    return await this.app.mysql.get('user', { name });
  }
  async register({name,pwd}){
    return await this.app.mysql.insert(`user`,{name,pwd})
  }
}

module.exports = loginService;
